﻿
using System;
using System.Collections.Generic;
using System.Web.UI.HtmlControls;

public partial class WebPage_YingXiao_YoujianYingxiao : MarketBBasePage
{
    protected string sendemailerror = string.Empty;


    private bool emailPay(string address, string title, string content)
    {
        if (address.IndexOf("\r\n") >= 0)
        {
            address = address.Replace("\r\n", ",");
        }
        string[] strArray = address.Split(new char[] { ',' });
        List<string> toMails = new List<string>();
        for (int i = 0; i < strArray.Length; i++)
        {
            toMails.Add(strArray[i]);
        }
        return base.SendMail(toMails, title, content, out this.sendemailerror);
    }

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        this.HeaderControl1.Select = "yingxiao";
        if ((base.Request.HttpMethod == "POST") && ((base.Request.Form["title"] != null) && (base.Request.Form["emails"] != null)))
        {
            if (this.emailPay(base.Request.Form["emails"].ToString(), base.Request.Form["title"].ToString(), base.Request.Form["content"].ToString()))
            {
                base.SetSuccess("发送成功!");
            }
            else
            {
                this.SetError("发送失败!");
            }
        }
    }
}

